package com.s.core.root.data;

import com.google.common.collect.Maps;
import com.s.core.root.D;
import com.s.core.root.strategy.base.FeatureContainer;
import com.s.core.root.strategy.base.Factor;
import com.s.core.root.strategy.factor.pic.*;
import com.s.core.root.strategy.factor.pic.combination.F_Pic_LastMaxStrong;
import com.s.core.root.strategy.factor.pic.combination.F_Pic_LastStrong;
import com.s.core.root.strategy.factor.pics.*;
import com.s.core.root.strategy.factor.pics.combination.*;
import com.s.core.root.strategy.factor.point.*;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

public class _AllData extends FeatureContainer {
    private static final List<Factor> FACTORS = new ArrayList<>();

    static {
        FACTORS.add(new F_Point_Last());
        FACTORS.add(new F_Point_Strong());
        FACTORS.add(new F_Point_Max());
        FACTORS.add(new F_Pic_LastStrong());
        FACTORS.add(new F_Pic_LastMaxStrong());
        FACTORS.add(new F_Pic_ActivityMax());
        FACTORS.add(new F_Pic_ActivityPair());
        FACTORS.add(new F_Pics_LastStrong());
        FACTORS.add(new F_Pics_LastMaxStrong());
        FACTORS.add(new F_Pics_LastBigMaxStrong());
        FACTORS.add(new F_Pics_ActivityPair());
        FACTORS.add(new F_Pics_Activity());
    }

    public static int LOAD_DAYS = 500;
    public static Map<Integer, Integer> LOAD_MAX = Maps.newHashMap();

    static {
        LOAD_MAX.put(1, 100);
        LOAD_MAX.put(2, 100);
        LOAD_MAX.put(3, 140);
        LOAD_MAX.put(4, 120);
        LOAD_MAX.put(5, 150);
        LOAD_MAX.put(6, 185);
        LOAD_MAX.put(7, 170);
        LOAD_MAX.put(8, 180);
        LOAD_MAX.put(9, 190);
        LOAD_MAX.put(10, 220);
        LOAD_MAX.put(11, 260);
        LOAD_MAX.put(12, 290);
        LOAD_MAX.put(13, 300);
        LOAD_MAX.put(14, 320);
        LOAD_MAX.put(15, 360);
        LOAD_MAX.put(16, 380);
        LOAD_MAX.put(17, 380);
        LOAD_MAX.put(18, 410);
        LOAD_MAX.put(19, 430);
        LOAD_MAX.put(20, 430);
        LOAD_MAX.put(21, 450);
        LOAD_MAX.put(22, 450);
        LOAD_MAX.put(23, 480);
        LOAD_MAX.put(24, 480);
        LOAD_MAX.put(25, 480);
    }

    public D d;
    public Map<Integer, _PicN> picNMap;
    public _Pic pic;

    public _AllData(D d) {
        this.d = d;
        pic = new _Pic(this, d, LOAD_MAX.get(1));
        picNMap = Maps.newHashMap();
        for (int n = 2; n <= 25; n++) {
            picNMap.put(n, new _PicN(this, d, LOAD_MAX.get(n), n));
        }

        doFactor();
    }

    private void doFactor() {
        FACTORS.forEach(t -> t.process(this));
    }
}
